<template>
<!--<div class="listBox">-->
<!--   <div class="list_item">-->
<!--      <div class="list_wrap">-->
<!--        <div class="wrap_title">-->
<!--          <span class="text">{{list.deviceName + '-' + list.deviceNo}}</span>-->
<!--          <Tag color="blue">{{$t('maintenance.projectsnumber')}}：{{list.itemNum}}</Tag>-->
<!--        </div>-->
<!--        <div class="wrap_tag">-->
<!--          <span class="text tag_item">{{list.deviceName}}</span>-->
<!--          <Tag color="yellow" class="tag_item">{{list.itemLevel}}</Tag>-->
<!--          <Tag color="blue" class="tag_item">{{list.isConfirm}}</Tag>-->
<!--        </div>-->

<!--        <div class="wrap_bot">-->
<!--          <div class="timeBox">-->
<!--             <span class="imgBox"><img src="@/assets/imgs/maintenance/time.png" alt=""/></span>-->
<!--            <span class="time_text">{{$t('maintenance.Tasktime')}}：{{list.createTime}}</span>-->
<!--          </div>-->
<!--          <span class="btn" v-if="list.status === 1" @click="startBao(list)">{{$t('maintenance.Tomaintain')}}</span>-->
<!--          <span class="btn" v-if="list.status === 2" @click="startBao(list)">{{$t('maintenance.maintenanceConfirm')}}</span>-->
<!--          <span class="checkbtn" v-if="Number(list.status) >= 3 " @click="startBao(list)">{{$t('maintenance.maintenanceCheck')}}</span>-->
<!--        </div>-->
<!--      </div>-->
<!--   </div>-->
<!--</div>-->
  <div class="item">
    <div class="name">
      <span>{{ list.deviceNo }}</span>
      <!--        <span>{{ list.deviceNo }}</span>-->
    </div>
    <div style="height: 26px;">
      <span class="text tag_item">{{list.deviceName}}</span>
      <Tag color="yellow" class="tag_item">{{list.itemLevel}}</Tag>
      <Tag color="blue" class="tag_item">{{list.isConfirm}}</Tag>
    </div>
    <div class="details">
      <div class="formItem">
        <!--保养单号：-->
        <div class="label">保养单号：</div>
        <div class="value num">{{ list.deviceMId }}</div>
      </div>
      <!--        <div class="preview" v-if="order.attachmentDTOs1 && order.attachmentDTOs1.length">-->
      <!--          <Badge :count="order.attachmentDTOs1 ? order.attachmentDTOs1.length : 0">-->
      <!--            <div class="preview-img">-->
      <!--              <template v-for="(item, index) in order.attachmentDTOs1">-->
      <!--                <div class="itemCol" @click="previewClicjk(item, index, order.attachmentDTOs1)">-->
      <!--                    <span class="item">-->
      <!--                      <template v-if="!item.filePath.includes('video')">-->
      <!--                        <img :src="util.filePathToUrl(item.filePath)" alt=""/>-->
      <!--                      </template>-->
      <!--                      <template>-->
      <!--                        <video preload="auto" loop autoplay muted>-->
      <!--                          <source :src="util.filePathToUrl(item.filePath)" type="video/mp4">-->
      <!--                        </video>-->
      <!--                      </template>-->
      <!--                    </span>-->
      <!--                </div>-->
      <!--              </template>-->
      <!--              &lt;!&ndash;                  <viewer :images="order.attachmentDTOs1">&ndash;&gt;-->
      <!--              &lt;!&ndash;                    <img&ndash;&gt;-->
      <!--              &lt;!&ndash;                            v-for="(src,index) in order.attachmentDTOs1"&ndash;&gt;-->
      <!--              &lt;!&ndash;                            :src="src.fileUrl"&ndash;&gt;-->
      <!--              &lt;!&ndash;                            :key="index"&ndash;&gt;-->
      <!--              &lt;!&ndash;                            style="width:40px;height:40px;overflow: hidden;"&ndash;&gt;-->
      <!--              &lt;!&ndash;                    >&ndash;&gt;-->
      <!--              &lt;!&ndash;                  </viewer>&ndash;&gt;-->
      <!--            </div>-->
      <!--          </Badge>-->
      <!--        </div>-->
      <div class="btnF">
        <span class="btn" v-if="list.status === 1" @click="startBao(list)">{{$t('maintenance.Tomaintain')}}</span>
        <span class="btn" v-if="list.status === 2" @click="startBao(list)">{{$t('maintenance.maintenanceConfirm')}}</span>
        <span class="checkbtn" v-if="Number(list.status) >= 3 " @click="startBao(list)">{{$t('maintenance.maintenanceCheck')}}</span>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "componentList",
  props: {
    list: {
      type: Object,
      default: ()=>{
        return {}
      },
    }
  },
  data(){
    return{}
  },
  methods:{
    startBao(data){
      const query = {
        code:data.code,
        deviceId:data.deviceId,
        deviceMId:data.deviceMId,
        status:data.status,
        taskId:data.taskId,
        deviceName:data.deviceName,
        orgId:data.orgId
      }
      this.$router.push({
        path:'/maintenanceDetail',
        query
      })
    }
  }
}
</script>

<style scoped lang="scss">
@import "index.scss";
</style>
